Combine all the data from two tables
If you want to combine all of the data from two lists that have similar but not identical data, such as two lists (tables) of customers that each have different information (fields) for each customer, and each list has some customers that aren't included on the other list, you can create a query that includes all of the customers. This type of query is called an outer join.
- Create a query in Microsoft Query, and add both tables to the query.
- To join a field that matches in two tables (for example, the Customer ID field
from two customer lists), drag the field in the first table to the second table.
Choose a field that has information for every
record in each table. For example, if two customer lists have matching fields for
Customer ID, join the Customer ID field.
- In the Join dialog box, select join type 2, and then click OK.
- Add the fields that you want to the query.
- Click SQL View.
- Select the text in SQL View, and then click Copy on the Edit menu.
- Click Query View, and then double-click the join line to open the Join
dialog box.
- In the Join dialog box, select join type 3, and then click OK.
- Click SQL View.
- Click at the end of the data in SQL View, press RETURN, type UNION,
and then press RETURN again.
- Click Paste on the Edit menu to paste the copied information after
the word UNION.
- Click Test!.
Note You will not be able to display this query in Query view.
Related topics
Add or remove fields
How joins affect the result set in a query